Skip to main content

All Questions

2votes
3answers
1kviews

Find the 'n' most frequent words in a text, aka word frequency

I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name. The ...
NPN328's user avatar
2votes
0answers
628views

Cron expression parser

Problem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
CodeYogi's user avatar
3votes
1answer
580views

Find the largest product of an array

This task is taken from www.interviewbit.com Given an array of integers, return the highest product possible by multiplying 3 numbers from the array Input: ...
thadeuszlay's user avatar
5votes
3answers
1kviews

Print out N by N Spiral Matrix in javascript

I got this question during my practice interview. Matrices - N Spiral Matrix Prompt Given an integer N, output an N x N spiral matrix with integers 1 through N. Examples: ...
NinjaG's user avatar
  • 2,539
1vote
1answer
915views

Hackerrank "Queues: A Tale of Two Stacks" Javascript Solution

Here is the original problem, and below is my solution (passing). It's asking to implement a queue with 2 stacks, which means I cannot simply use Array.shift. I wonder if the solution can be improved. ...
kdenz's user avatar
18votes
4answers
2kviews

O(N) vs O(N * N) for Word Frequency Algorithm

I am trying to come up with a better solution to the following problem: Statement You are supposed to write a function which takes the contents of a document in string format and also a whole ...
ng-hacker-319's user avatar

close